/* 
 * File:   generator.c
 * Author: nikolas
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include "configGenerator.h"

/* =============================================================================
 * Generate a Glider
 */
struct array* buildGlider()
{
    struct array* arr = createToroidalArray( 10, 10 );
    populateArrayWithWhite( arr );
    set( arr, 0, 1, GREEN );
    set( arr, 1, 2, GREEN );
    set( arr, 2, 0, GREEN );
    set( arr, 2, 1, GREEN );
    set( arr, 2, 2, GREEN );
    return arr;
}

/* =============================================================================
 * Generate an Exploder
 */
struct array* buildExploder()
{
    struct array* arr = createToroidalArray( 15, 15 );
    populateArrayWithWhite( arr );
    set( arr, 5, 5, GREEN );
    set( arr, 6, 5, GREEN );
    set( arr, 7, 5, GREEN );
    set( arr, 8, 5, GREEN );
    set( arr, 9, 5, GREEN );
    set( arr, 5, 7, GREEN );
    set( arr, 9, 7, GREEN );
    set( arr, 5, 9, GREEN );
    set( arr, 6, 9, GREEN );
    set( arr, 7, 9, GREEN );
    set( arr, 8, 9, GREEN );
    set( arr, 9, 9, GREEN );
    return arr;
}

